/*
 * Menu.h
 *
 *  Created on: 2011-03-30
 *      Author: tmacyszyn
 */

#ifndef MENU_H_
#define MENU_H_

#include <FBase.h>
#include <FGraphics.h>
#include <vector>
#include "MenuItem.h"

using namespace std;
using namespace Osp::Base;
using namespace Osp::Graphics;

class Menu {
public:
	Menu(Font* font, void* parent);
	virtual ~Menu();

	void Init();
	//void AddItem(String title, void (*OnClickHandler)());
	void AddItem(String title, void (*OnClickHandler)(void*));
	void Build();
	void Render();
	void CleanUp();
	// true if menu item has been hit
	// false
	bool HandleInput(float x, float y);

	bool IsPointInside(float x, float y);


private:
	void* parent;
	vector<MenuItem*> items;
	Osp::Graphics::Canvas* textCanvas;
	Osp::Graphics::EnrichedText* enrichedText;
	Font* font;

	float width;
	float height;
	float posX;
	float posY;
};

#endif /* MENU_H_ */
